#include <stdio.h>
#include <stdlib.h>

int main (int argc, char const* argv[])
{
    int c, n, t, i, j, k;
    int a[64], b[64];

    scanf("%d", &c);
    while (c--) {
        scanf("%d", &n);
        for (i = 0; i < n; i++) {
            scanf("%d %d", &a[i], &b[i]);
        }
        for (i = 0; i < n-1; i++) {
            for (j = i+1; j < n; j++) {
                if (a[i] > a[j]) {
                    t = a[i]; a[i] = a[j]; a[j] = t;
                    t = b[i]; b[i] = b[j]; b[j] = t;
                }
            }
        }


        for (k = 0; k < n; k++) {
            for (i = 0; i < b[k]; i++) {
                printf(">+");
                for (j = 0; j < a[k]-2; j++) {
                    printf("-");
                }
                printf("+>");
                printf("\n");
            }
            printf("\n");
        }
    }

    return 0;
}
